package _select

import "fmt"

type sortType interface {
	int | int8 | int16 | int32 | int64 |
		uint | uint8 | uint16 | uint32 | uint64 | uintptr |
		float32 | float64 | string
}

func Sort[T sortType](arr []T) {
	count := 0
	for i := range arr {
		for j := i + 1; j < len(arr); j++ {
			if arr[i] <= arr[j] {
				continue
			}
			arr[i], arr[j] = arr[j], arr[i]
			count++
		}
	}
	fmt.Println(count)
}
